<extend name="Public:common"/>
<block name="css">
    <style>
        .type-item {
            background: #ccc;
            width: 100px;
            text-align: center;
            padding: 5px 0;
        }
        th{text-align:center;}
    </style>
</block>
<block name="content">
    <div class="page-header" style="background-color: #fff!important"><h1><i class="fa fa-home"></i> 首页 &gt;产品管理&gt;线路发布
    </h1></div>
    <ul id="nav" class="nav nav-tabs">
        <li role="presentation" class=""><a href="javascript:void(0)">第一步基本信息</a></li>
        <li role="presentation" class="active"><a href="javascript:void(0)">第二步价格计划</a></li>
        <li role="presentation" class=""><a href="javascript:void(0)">第三步行程安排</a></li>
        <li role="presentation" class=""><a href="javascript:void(0)">第四步签证添加</a></li>
        <li role="presentation" class=""><a href="javascript:void(0)">第五步附加产品</a></li>
    </ul>

    <div class="tab-content">
        <div class="panelsd" style="display: block !important;">
            <!-- 价格计划 第二步-->
            <div class="paneld" style="display: block !important;">
                <form action="{:U('step2_action')}" method="post">
                    <input type="hidden" name="id" value="{:I('id')}">
                    <!-- 隐藏域传递当前是第几步 -->
                    <div class="row">
                        <div class="col-md-2 text-right">
                            <h4>已选择的基础产品</h4>
                        </div>
                        <div class="col-md-10">
                            <div class="row">
                                <div class="col-md-12 col-xs-12">
                                    <label class="type-item ">交通方式(去)</label>

                                    <table class="table table-striped table-bordered table-hover table-condensed text-center">
                                        <tbody>
                                        <tr>
                                            <th>供应商</th>
                                            <th>线路名称</th>
                                            <th>币种</th>
                                            <th>交通方式</th>
                                            <th>座位</th>
                                            <th>数量</th>
                                            <th>成人价</th>
                                            <th>儿童价</th>
                                        </tr>
                                        <tr>
                                            <td>{$goTraffic.supplier_name}</td>
                                            <td>{$goTraffic.routes_name}</td>
                                            <td>{$goTraffic.money_type}</td>
                                            <td>{$goTraffic.traffic_name}</td>
                                            <td>{$goTraffic.seat_name}</td>
                                            <td>{$goTraffic.seat_num}</td>
                                            <td>{$goTraffic.adult_actual_cost}</td>
                                            <td>{$goTraffic.child_actual_cost}</td>
                                        </tr>
                                        </tbody>
                                    </table>

                                </div>



                            </div>
                            <div class="row">
                                <div class="col-md-12 col-xs-12">
                                    <label class="type-item ">交通方式(回)</label>
                                    <table class="table table-striped table-bordered table-hover table-condensed text-center">
                                        <tbody>
                                        <tr>
                                            <th>供应商</th>
                                            <th>线路名称</th>
                                            <th>币种</th>
                                            <th>交通方式</th>
                                            <th>座位</th>
                                            <th>数量</th>
                                            <th>成人成本价</th>
                                            <th>儿童成本价</th>
                                        </tr>
                                        <tr>
                                            <td>{$backTraffic.supplier_name}</td>
                                            <td>{$backTraffic.routes_name}</td>
                                            <td>{$backTraffic.money_type}</td>
                                            <td>{$backTraffic.traffic_name}</td>
                                            <td>{$backTraffic.seat_name}</td>
                                            <td>{$backTraffic.seat_num}</td>
                                            <td>{$backTraffic.adult_actual_cost}</td>
                                            <td>{$backTraffic.child_actual_cost}</td>
                                        </tr>
                                        </tbody>
                                    </table>

                                </div>

                            </div>

                            <div class="row">
                                <div class="col-md-12 col-xs-12">
                                    <label class="type-item ">打包酒店列表</label>
                                    <label class="label label-primary" for="">打包给运营商的价格: <b>{$line_info.hotel_price}</b></label>
                                    <table class="table table-striped table-bordered table-hover table-condensed text-center">
                                        <tbody>
                                        <tr>
                                            <th>供应商</th>
                                            <th>币种</th>
                                            <th>名称</th>
                                            <th>等级</th>
                                            <th>数量</th>
                                            <th>成人成本价</th>
                                            <th>儿童成本价</th>
                                        </tr>
                                        <volist name="checkedHotel" id="vo">
                                            <tr>
                                                <td>{$vo.supplier_name}</td>
                                                <td>{$vo.money_type}</td>
                                                <td>{$vo.room_name}</td>
                                                <td>{$vo.star_level}</td>
                                                <td>{$vo.room_count}</td>
                                                <td>{$vo.adult_actual_cost}</td>
                                                <td>{$vo.child_actual_cost}</td>
                                            </tr>
                                        </volist>
                                        </tbody>
                                    </table>
                                </div>
                            </div>





                            <div class="row">
                                <div class="col-md-12 col-xs-12">
                                    <label class="type-item ">包含景区列表</label>
                                    <table class="table table-striped table-bordered table-hover table-condensed text-center">
                                        <tbody>
                                        <tr>
                                            <th>供应商</th>
                                            <th>币种</th>
                                            <th>名称</th>
                                            <th>级别</th>
                                            <th>成人成本价</th>
                                            <th>儿童成本价</th>
                                        </tr>
                                        <volist name="checkedScenic" id="vo">
                                            <tr>
                                                <td>{$vo.supplier_name}</td>
                                                <td>{$vo.money_type}</td>
                                                <td>{$vo.scenic_name}</td>
                                                <td>{$vo.scenic_level}A</td>
                                                <td>{$vo.adult_actual_cost}</td>
                                                <td>{$vo.child_actual_cost}</td>
                                            </tr>
                                        </volist>
                                        </tbody>
                                    </table>
                                </div>
                            </div>


                        </div>
                    </div>
                    <hr>
                    <div class="row">
                        <div class="col-md-2 text-right">
                            <h4>给运营商的价格</h4>
                        </div>
                        <div class="col-md-10">
                            <div class="row">
                                <div class="col-md-4 col-xs-4">
                                    <label class="type-item ">成人价</label>
                                    <input type="text" required name="adult_money" id="adult_money" maxlength="50"
                                           value="{$line_info['adult_money']}"
                                           onkeyup="clearNoNum(this)"
                                           onafterpaste="clearNoNum(this)">
                                </div>
                                <div class="col-md-4 col-xs-4">
                                    <label class="type-item">儿童价</label>
                                    <input type="text" required id="child_money" name="child_money" maxlength="50"
                                           value="{$line_info['child_money']}"
                                           onkeyup="clearNoNum(this)"
                                           onafterpaste="clearNoNum(this)">
                                </div>
                                <div class="col-md-4 col-xs-4">
                                    <label class="type-item">老人价</label>
                                    <input type="text" required id="oldman_money" name="oldman_money" maxlength="50"
                                           value="{$line_info['oldman_money']}"
                                           onkeyup="clearNoNum(this)"
                                           onafterpaste="clearNoNum(this)">
                                </div>
                            </div>
                        </div>
                    </div>
                    <hr>
                    <div class="row">
                        <div class="col-md-2 text-right">
                            <h4>可选服务</h4>
                        </div>
                        <div class="col-md-10">
                            <div class="row">
                                <div class="col-md-12 col-xs-12">
                                    <label class="type-item ">可酒店升级列表</label>
                                    <table class="table table-striped table-bordered table-hover table-condensed text-center">
                                        <tbody>
                                        <tr>
                                            <th>供应商</th>
                                            <th>币种</th>
                                            <th>名称</th>
                                            <th>星级</th>
                                            <th>数量</th>
                                            <th>成人成本价</th>
                                            <th>儿童成本价</th>
                                            <th>统一升级费用</th>
                                        </tr>



                                        <volist name="upgradeHotel" id="vo">
                                            <tr>
                                                <td>{$vo.supplier_name}</td>
                                                <td>{$vo.money_type}</td>
                                                <td>{$vo.room_name}</td>
                                                <td>{$vo.star_level}</td>
                                                <td>{$vo.room_count}</td>
                                                <td>{$vo.adult_actual_cost}</td>
                                                <td>{$vo.child_actual_cost}</td>
                                                <td>{$vo.to_operator_price}</td>
                                            </tr>
                                        </volist>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-md-12 col-xs-12">
                                    <label class="type-item ">可选保险</label>
                                    <table class="table table-striped table-bordered table-hover table-condensed text-center">
                                        <tbody>
                                        <tr>
                                            <th>供应商</th>
                                            <th>币种</th>
                                            <th>名称</th>
                                            <th>成人成本价</th>
                                            <th>儿童成本价</th>
                                            <th>成人销售价</th>
                                            <th>儿童销售价</th>
                                        </tr>
                                        <volist name="checkedInsure" id="vo">
                                            <tr>
                                                <td>{$vo.supplier_name}</td>
                                                <td>{$vo.money_type}</td>
                                                <td>{$vo.insure_name}</td>
                                                <td>{$vo.adult_actual_cost}</td>
                                                <td>{$vo.child_actual_cost}</td>
                                                <td>{$vo.now_adult_price}</td>
                                                <td>{$vo.now_child_price}</td>
                                            </tr>
                                        </volist>
                                        </tbody>
                                    </table>
                                </div>
                            </div>

                            <div class="row">
                                <div class="col-md-12 col-xs-12">
                                    <label class="type-item ">可选坐席</label>
                                    <table class="table table-striped table-bordered table-hover table-condensed text-center">
                                        <tbody>
                                        <tr>
                                            <th>坐席</th>
                                            <th>币种</th>
                                            <th>出发|回来</th>
                                            <th>成人成本价</th>
                                            <th>儿童成本价</th>
                                            <th>成人销售价</th>
                                            <th>儿童销售价</th>
                                        </tr>
                                        <volist name="upgradeTrafficList" id="vo">
                                            <tr>
                                                <td>{$vo.seat_name}</td>
                                                <td>{$vo.origin_money_type}</td>
                                                <td>
                                                    <switch name="vo.type">
                                                        <case value="1">出发</case>
                                                        <case value="2">返回</case>
                                                    </switch>
                                                </td>
                                                <td>{$vo.origin_adult_price}</td>
                                                <td>{$vo.origin_child_price}</td>
                                                <td>{$vo.now_adult_price}</td>
                                                <td>{$vo.now_child_price}</td>
                                            </tr>
                                        </volist>
                                        </tbody>
                                    </table>
                                </div>
                            </div>

                        </div>
                    </div>
                    <hr>
                    <div class="row" style="padding:10px;">
                        <div class="col-md-2 text-right"></div>
                        <div class="col-md-10">
                            <span class="btn btn-primary btn-xs" onclick="specialDayPrice({:I('id')})">特殊日期价格编辑</span>
                            <h4>给运营商的特殊价格列表:</h4>
                        </div>

                    </div>

                    <!--特殊价格-->
                    <div id="special">

                        <volist name="specialList" id="vo">
                            <div class="row special_{$vo.day}">
                                <div class="col-md-2 text-right"><span class="label label-success">{$vo.day}</span> <span
                                        class="delSpecial" data-id="{$vo.day}">[删除]</span></div>
                                <div class="col-md-10">
                                    <div class="row">
                                        <div class="col-md-4 col-xs-4 col-xs-4"><label class="type-item ">成人价</label> <input
                                                type="text" required="required" name="special[{$vo.day}][adult]"
                                                maxlength="50" value="{$vo.adult_price}" onkeyup="clearNoNum(this)"
                                                onafterpaste="clearNoNum(this)"></div>
                                        <div class="col-md-4 col-xs-4"><label class="type-item">儿童价</label> <input
                                                type="text" required="required" name="special[{$vo.day}][child]"
                                                maxlength="50" value="{$vo.child_price}" onkeyup="clearNoNum(this)"
                                                onafterpaste="clearNoNum(this)"></div>
                                        <div class="col-md-4 col-xs-4"><label class="type-item">老人价</label> <input
                                                type="text" required="required" name="special[{$vo.day}][oldman]"
                                                maxlength="50" value="{$vo.oldman_price}" onkeyup="clearNoNum(this)"
                                                onafterpaste="clearNoNum(this)"></div>
                                    </div>
                                </div>
                            </div>
                        </volist>
                    </div>
                    <hr>

                    <div class="row">
                        <div class="col-md-2 text-right">
                        </div>
                        <div class="col-md-5">
                            <div class="row">
                                <div class="col-md-12">
                                    <label class="type-item ">补房差</label>
                                    <input type="tel" name="add_room_price" maxlength="50"
                                           value="{$line_info['add_room_price']}"
                                           onkeyup="clearNoNum(this)"
                                           onafterpaste="clearNoNum(this)"> <span>元/人</span>
                                </div>
                            </div>
                        </div>
                        <!--<div class="col-md-5">
                            <div class="row">
                                <div class="col-md-12">
                                    <label class="type-item ">减房差</label>
                                    <input type="tel" name="minus_room_price" maxlength="50"
                                           value="{$line_info['minus_room_price']}"
                                           onkeyup="clearNoNum(this)"
                                           onafterpaste="clearNoNum(this)"><span>元/人</span>
                                </div>
                            </div>
                        </div>-->
                    </div>

                    <div class="row">
                        <div class="col-md-2 text-right">
                        </div>
                        <div class="col-md-10">
                            <div class="row">
                                <div class="col-md-12">
                                    <label class="type-item ">排序</label>
                                    <input type="tel" name="line_sort" value="{$line_info['line_sort']}" maxlength="50"
                                           onkeyup="this.value=this.value.replace(/\D/g,'')"
                                           onafterpaste="this.value=this.value.replace(/\D/g,'')"><span class="explain">数值越小，越优先显示，排序功能仅仅针对您自己的网站</span>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="row">
                        <div class="col-md-2 text-right">
                        </div>
                        <div class="col-md-10">
                            <div class="row">
                                <div class="col-md-12">
                                    <label class="type-item ">状态</label>
                                    <input class="form-radio" type='radio' width="30"  name='is_show'
                                    <if condition="$line_info['is_show'] == 0">checked="checked"</if>
                                    value='0'/><span>隐藏</span>
                                    <input class="form-radio" type='radio' width="30"  name='is_show'
                                    <if condition="$line_info['is_show'] == 1">checked="checked"</if>   value='1'/><span>显示</span>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-2 text-right">
                        </div>
                        <div class="col-md-10">
                            <div class="row">
                                <div class="col-md-12">
                                    <label class="type-item ">优惠设置</label>
                                    满&nbsp;<input type="text" onkeyup="this.value=this.value.replace(/\D/g,'')"
                                                  onafterpaste="this.value=this.value.replace(/\D/g,'')"
                                                  name="discounts_condition" maxlength="50"
                                                  value="{$line_info['discounts_condition']}">人
                                    优惠&nbsp;<input type="text" onkeyup="clearNoNum(this)"
                                                   onafterpaste="clearNoNum(this)"
                                                   name="discounts" value="{$line_info['discounts']}"/>元
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row text-center">
                        <a href="{:U('form_step1',array('id'=>I('id')))}" class="btn btn-info">上一步</a>
                        <input type="submit" name="" class="btn btn-warning" value="保存 进入下一步"/>
                        <a href="{:U('form_step3',array('id'=>I('id')))}" class="btn btn-info">跳过</a>
                    </div>
                </form>
            </div>
        </div>
    </div>
</block>
<block name="js">
    <script type="text/javascript" src="__STATIC__/layer/layer.js"></script>
    <script src="__STATIC__/layui/layui.all.js"></script>
    <script src="__STATIC__/layui/layui.js"></script>
    <script src="__STATIC__/Dealer/js/line.js"></script>
    <script>
        var foreign_adult_cost = {$line_info['adult_cost']};
        var foreign_child_cost = {$line_info['child_cost']};
        var foreign_oldman_cost = {$line_info['oldman_cost']};
        $('body').on('change', '#exchange_rate', function () {
            var rate = $(this).val();
            $('#foreign_adult_cost').val((rate * foreign_adult_cost).toFixed(2));
            $('#foreign_child_cost').val((rate * foreign_child_cost).toFixed(2));
            $('#foreign_oldman_cost').val((rate * foreign_oldman_cost).toFixed(2));
        })
    </script>
</block>

